ReactOS  0.4.14-dev-317-g96040ec
filter.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for filter.c:

Go to the source code of this file.

Macros

#define YDEBUG
 

Functions

ULONG MMixerGetFilterPinCount (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer)
 
MIXER_STATUS MMixerGetFilterTopologyProperty (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG PropertyId, OUT PKSMULTIPLE_ITEM *OutMultipleItem)
 
MIXER_STATUS MMixerGetPhysicalConnection (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG PinId, OUT PKSPIN_PHYSICALCONNECTION *OutConnection)
 
ULONG MMixerGetControlTypeFromTopologyNode (IN LPGUID NodeType)
 
MIXER_STATUS MMixerSetGetControlDetails (IN PMIXER_CONTEXT MixerContext, IN HANDLE hMixer, IN ULONG NodeId, IN ULONG bSet, IN ULONG PropertyId, IN ULONG Channel, IN PLONG InputValue)
 
ULONG MMixerGetPinInstanceCount (PMIXER_CONTEXT MixerContext, HANDLE hFilter, ULONG PinId)
 

Macro Definition Documentation

◆ YDEBUG

#define YDEBUG

Definition at line 11 of file filter.c.

Function Documentation

◆ MMixerGetControlTypeFromTopologyNode()

ULONG MMixerGetControlTypeFromTopologyNode ( IN LPGUID  NodeType)

Definition at line 139 of file filter.c.

141 {
143  {
144  /* automatic gain control */
146  }
148  {
149  /* loudness control */
151  }
153  {
154  /* mute control */
156  }
158  {
159  /* tone control
160  * FIXME
161  * MIXERCONTROL_CONTROLTYPE_ONOFF if KSPROPERTY_AUDIO_BASS_BOOST is supported
162  * MIXERCONTROL_CONTROLTYPE_BASS if KSPROPERTY_AUDIO_BASS is supported
163  * MIXERCONTROL_CONTROLTYPE_TREBLE if KSPROPERTY_AUDIO_TREBLE is supported
164  */
167  }
169  {
170  /* volume control */
172  }
174  {
175  /* peakmeter control */
177  }
179  {
180  /* mux control */
182  }
184  {
185  /* mux control */
187  }
189  {
190  /* stero wide control */
192  }
194  {
195  /* chorus control */
197  }
199  {
200  /* reverb control */
202  }
204  {
205  /* supermix control
206  * MIXERCONTROL_CONTROLTYPE_MUTE if KSPROPERTY_AUDIO_MUTE is supported
207  */
210  }
211  /* TODO
212  * check for other supported node types
213  */
214  //UNIMPLEMENTED;
215  return 0;
216 }
#define MIXERCONTROL_CONTROLTYPE_MUX
Definition: mmsystem.h:403
const GUID KSNODETYPE_TONE
Definition: sup.c:20
const GUID KSNODETYPE_PEAKMETER
Definition: sup.c:22
const GUID KSNODETYPE_MUTE
Definition: sup.c:19
const GUID KSNODETYPE_VOLUME
Definition: sup.c:21
const GUID KSNODETYPE_MUX
Definition: sup.c:23
#define IsEqualGUIDAligned(guid1, guid2)
Definition: wdm.template.h:233
const GUID KSNODETYPE_LOUDNESS
Definition: sup.c:18
const GUID KSNODETYPE_SUPERMIX
Definition: sup.c:27
const GUID KSNODETYPE_STEREO_WIDE
Definition: sup.c:24
NodeType
Definition: Node.h:5
#define MIXERCONTROL_CONTROLTYPE_LOUDNESS
Definition: mmsystem.h:386
const GUID KSNODETYPE_AGC
Definition: sup.c:17
const GUID KSNODETYPE_REVERB
Definition: sup.c:26
#define MIXERCONTROL_CONTROLTYPE_VOLUME
Definition: mmsystem.h:398
#define MIXERCONTROL_CONTROLTYPE_FADER
Definition: mmsystem.h:397
#define MIXERCONTROL_CONTROLTYPE_MUTE
Definition: mmsystem.h:384
const GUID KSNODETYPE_CHORUS
Definition: sup.c:25
#define MIXERCONTROL_CONTROLTYPE_ONOFF
Definition: mmsystem.h:383
#define UNIMPLEMENTED
Definition: debug.h:114
#define MIXERCONTROL_CONTROLTYPE_PEAKMETER
Definition: mmsystem.h:380

Referenced by MMixerAddMixerControl().

◆ MMixerGetFilterPinCount()

ULONG MMixerGetFilterPinCount ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer 
)

Definition at line 15 of file filter.c.

18 {
21  ULONG NumPins, BytesReturned;
22 
23  /* setup property request */
25  Pin.Set = KSPROPSETID_Pin;
27 
28  /* query pin count */
30 
31  /* check for success */
33  return 0;
34 
35  return NumPins;
36 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
HMIXER hMixer
Definition: test.c:10
const GUID KSPROPSETID_Pin
Definition: filter.c:47
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
ULONG Flags
Definition: ntfs.h:532
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int * PULONG
Definition: retypes.h:1
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerBuildTopology().

◆ MMixerGetFilterTopologyProperty()

MIXER_STATUS MMixerGetFilterTopologyProperty ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer,
IN ULONG  PropertyId,
OUT PKSMULTIPLE_ITEM OutMultipleItem 
)

Definition at line 39 of file filter.c.

44 {
46  PKSMULTIPLE_ITEM MultipleItem;
49 
50  /* setup property request */
51  Property.Id = PropertyId;
54 
55  /* query for the size */
57 
59  return Status;
60 
61  /* sanity check */
63 
64  /* allocate an result buffer */
66 
67  if (!MultipleItem)
68  {
69  /* not enough memory */
70  return MM_STATUS_NO_MEMORY;
71  }
72 
73  /* query again with allocated buffer */
75 
77  {
78  /* failed */
79  MixerContext->Free((PVOID)MultipleItem);
80  return Status;
81  }
82 
83  /* store result */
84  *OutMultipleItem = MultipleItem;
85 
86  /* done */
87  return Status;
88 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
HMIXER hMixer
Definition: test.c:10
smooth NULL
Definition: ftsmooth.c:416
PMIXER_FREE Free
Definition: mmixer.h:96
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct KSMULTIPLE_ITEM * PKSMULTIPLE_ITEM
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
const GUID KSPROPSETID_Topology
Definition: filter.c:46
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerBuildTopology().

◆ MMixerGetPhysicalConnection()

MIXER_STATUS MMixerGetPhysicalConnection ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer,
IN ULONG  PinId,
OUT PKSPIN_PHYSICALCONNECTION OutConnection 
)

Definition at line 91 of file filter.c.

96 {
97  KSP_PIN Pin;
100  PKSPIN_PHYSICALCONNECTION Connection;
101 
102  /* setup the request */
103  Pin.Property.Flags = KSPROPERTY_TYPE_GET;
105  Pin.Property.Set = KSPROPSETID_Pin;
106  Pin.PinId = PinId;
107 
108  /* query the pin for the physical connection */
110 
112  {
113  /* pin does not have a physical connection */
114  return Status;
115  }
116  DPRINT("Status %u BytesReturned %lu\n", Status, BytesReturned);
118  if (!Connection)
119  {
120  /* not enough memory */
121  return MM_STATUS_NO_MEMORY;
122  }
123 
124  /* query the pin for the physical connection */
126  if (Status != MM_STATUS_SUCCESS)
127  {
128  /* failed to query the physical connection */
129  MixerContext->Free(Connection);
130  return Status;
131  }
132 
133  // store connection
134  *OutConnection = Connection;
135  return Status;
136 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
struct KSPIN_PHYSICALCONNECTION * PKSPIN_PHYSICALCONNECTION
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
HMIXER hMixer
Definition: test.c:10
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
const GUID KSPROPSETID_Pin
Definition: filter.c:47
Definition: ks.h:642
PMIXER_FREE Free
Definition: mmixer.h:96
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
ULONG Flags
Definition: ntfs.h:532
PMIXER_ALLOC Alloc
Definition: mmixer.h:94
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

Referenced by MMixerApplyOutputFilterHack(), MMixerGetComponentAndTargetType(), and MMixerInitializeFilter().

◆ MMixerGetPinInstanceCount()

ULONG MMixerGetPinInstanceCount ( PMIXER_CONTEXT  MixerContext,
HANDLE  hFilter,
ULONG  PinId 
)

Definition at line 264 of file filter.c.

268 {
269  KSP_PIN PinRequest;
270  KSPIN_CINSTANCES PinInstances;
273 
274  /* query the instance count */
275  PinRequest.Reserved = 0;
276  PinRequest.PinId = PinId;
277  PinRequest.Property.Set = KSPROPSETID_Pin;
278  PinRequest.Property.Flags = KSPROPERTY_TYPE_GET;
280 
281  Status = MixerContext->Control(hFilter, IOCTL_KS_PROPERTY, (PVOID)&PinRequest, sizeof(KSP_PIN), (PVOID)&PinInstances, sizeof(KSPIN_CINSTANCES), &BytesReturned);
283  return PinInstances.CurrentCount;
284 }
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
GUID Set
Definition: dmksctrl.h:76
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
KSPROPERTY Property
Definition: ks.h:643
const GUID KSPROPSETID_Pin
Definition: filter.c:47
ULONG PinId
Definition: ks.h:644
Definition: ks.h:642
ULONG Id
Definition: dmksctrl.h:77
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ULONG Flags
Definition: dmksctrl.h:78
ULONG Reserved
Definition: ks.h:645
Status
Definition: gdiplustypes.h:24
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1

◆ MMixerSetGetControlDetails()

MIXER_STATUS MMixerSetGetControlDetails ( IN PMIXER_CONTEXT  MixerContext,
IN HANDLE  hMixer,
IN ULONG  NodeId,
IN ULONG  bSet,
IN ULONG  PropertyId,
IN ULONG  Channel,
IN PLONG  InputValue 
)

Definition at line 219 of file filter.c.

227 {
230  LONG Value;
232 
233  if (bSet)
234  Value = *InputValue;
235 
236  /* setup the request */
238 
239  Property.NodeProperty.NodeId = NodeId;
240  Property.NodeProperty.Property.Id = PropertyId;
241  Property.NodeProperty.Property.Flags = KSPROPERTY_TYPE_TOPOLOGY;
242  Property.NodeProperty.Property.Set = KSPROPSETID_Audio;
243  Property.Channel = Channel;
244  Property.Reserved = 0;
245 
246  if (bSet)
247  Property.NodeProperty.Property.Flags |= KSPROPERTY_TYPE_SET;
248  else
249  Property.NodeProperty.Property.Flags |= KSPROPERTY_TYPE_GET;
250 
251  /* send the request */
253 
254  if (!bSet && Status == MM_STATUS_SUCCESS)
255  {
256  *InputValue = Value;
257  }
258 
259  DPRINT("Status %x bSet %u NodeId %u Value %d PropertyId %u\n", Status, bSet, NodeId, Value, PropertyId);
260  return Status;
261 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
#define IOCTL_KS_PROPERTY
Definition: ks.h:127
_In_ PSTORAGE_PROPERTY_ID PropertyId
Definition: classpnp.h:966
#define KSPROPSETID_Audio
Definition: ksmedia.h:951
#define KSPROPERTY_TYPE_GET
Definition: dmksctrl.h:42
MIXER_CONTEXT MixerContext
Definition: mmixer.c:46
PMIXER_DEVICE_CONTROL Control
Definition: mmixer.h:95
long LONG
Definition: pedump.c:60
HMIXER hMixer
Definition: test.c:10
void DPRINT(...)
Definition: polytest.cpp:61
Status
Definition: gdiplustypes.h:24
_In_ DWORD Property
Definition: setupapi.h:1545
MIXER_STATUS
Definition: mmixer.h:3
_In_ FILTER_INFORMATION_CLASS _In_ ULONG _Out_ PULONG BytesReturned
Definition: fltkernel.h:1716
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define KSPROPERTY_TYPE_TOPOLOGY
Definition: dmksctrl.h:53
#define KSPROPERTY_TYPE_SET
Definition: dmksctrl.h:43
Property(long _type, long _tag, INREAL _value)
Definition: reader.h:125

Referenced by MMixerSetGetMuteControlDetails(), and MMixerSetGetVolumeControlDetails().