ReactOS 0.4.16-dev-329-g9223134
splitter.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS Kernel Streaming
4 * FILE: drivers/wdm/audio/filters/splitter/splitter.c
5 * PURPOSE: Splitter entry point
6 * PROGRAMMER: Johannes Anderwald
7 */
8
9#include "precomp.h"
10
11const GUID PIN_VIDEO_CAPTURE = {0xfb6c4281, 0x0353, 0x11d1, {0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba}};
12const GUID KSPROPSETID_Audio = {0x45FFAAA0, 0x6E1B, 0x11D0, {0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}};
13const GUID KSCATEGORY_AUDIO_SPLITTER = {0x9EA331FA, 0xB91B, 0x45F8, {0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE}};
14const GUID KSNAME_Filter = {0x9b365890, 0x165f, 0x11d0, {0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}};
15const GUID GUID_NULL = {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
16
17
18KSPROPERTY_ITEM
20{
21 {
24 sizeof(KSPROPERTY),
25 sizeof(KSAUDIO_POSITION),
27 NULL,
28 0,
29 NULL,
30 NULL,
31 0
32 }
33};
34
35const
36KSPROPERTY_SET
38{
39 {
41 1,
43 0,
44 NULL
45 }
46};
47
48
49const
50KSAUTOMATION_TABLE
52{
53 1,
54 sizeof(PinPropertySet) / sizeof(KSPROPERTY_SET),
55 (const KSPROPERTY_SET*)&PinPropertySet,
56 0,
57 sizeof(KSMETHOD_SET),
58 NULL,
59 0,
60 sizeof(KSEVENT_SET),
61 NULL
62};
63
64const
65KSPIN_DISPATCH
67{
70 NULL, /* filter centric processing */
72 NULL,
74 NULL,
75 NULL,
76 NULL,
77 NULL
78};
79
80
81const
82KSFILTER_DISPATCH
84{
85 NULL,
86 NULL,
88 NULL
89};
90
93{
94 {
95 sizeof(KSDATARANGE),
96 0,
97 0,
98 0,
102 }
103};
104
105const
108{
110};
111
112#if 0
113const
116{
117 1,
118 0,
119 {
120 1,
121 1,
122 0
123 },
124 0,
125 {
129 0,
130 0, //KSALLOCATOR_REQUIREMENTF_PREFERENCES_ONLY | KSALLOCATOR_FLAG_INSIST_ON_FRAMESIZE_RATIO | KSALLOCATOR_OPTIONF_VALID
131 8,
133 0,
134 {
135 0,
136 MAXULONG,
137 1
138 },
139 {
140 {
141 1536, // (48000khz * 2 channels * 16bit / 1000 ) * 8 frames
142 1536,
143 1
144 },
145 0,
146 0
147 }
148 }
149};
150#endif
151
152const
153KSPIN_DESCRIPTOR_EX
155{
156 {
159 {
160 0, //no interfaces
161 NULL,
162 0, // no mediums
163 NULL,
164 sizeof(PinDataFormatRange) / sizeof(PKSDATARANGE),
168 NULL,
169 (const GUID*)&PIN_VIDEO_CAPTURE,
170 {
171 0,
172 }
173 },
174 KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING | KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL |
175 KSPIN_FLAG_FRAMES_NOT_REQUIRED_FOR_PROCESSING | KSPIN_FLAG_PROCESS_IF_ANY_IN_RUN_STATE,
176 MAXULONG,
177 1,
178 NULL, //&AllocatorFraming,
180 },
181 {
184 {
185 0, //no interfaces
186 NULL,
187 0, // no mediums
188 NULL,
189 1,
193 NULL,
194 NULL,
195 {
196 0
197 }
198 },
199 KSPIN_FLAG_DISPATCH_LEVEL_PROCESSING | KSPIN_FLAG_INITIATE_PROCESSING_ON_EVERY_ARRIVAL | KSPIN_FLAG_PROCESS_IF_ANY_IN_RUN_STATE,
200 1,
201 1,
202 NULL, //&AllocatorFraming,
204 }
205};
206const
207GUID
209{
212};
213
214
215const
216KSNODE_DESCRIPTOR
218{
219 {
220 NULL, //automation table
222 NULL // name
223 }
224};
225
226
227const
228KSFILTER_DESCRIPTOR
230{
232 NULL,
233 KSFILTER_DESCRIPTOR_VERSION,
234 KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING,
236 2,
237 sizeof(KSPIN_DESCRIPTOR_EX),
238 (const KSPIN_DESCRIPTOR_EX*)&PinDescriptors,
239 sizeof(Categories) / sizeof(GUID),
240 (const GUID* )&Categories,
241 sizeof(NodeDescriptor) / sizeof(KSNODE_DESCRIPTOR),
242 sizeof(KSNODE_DESCRIPTOR),
243 (const KSNODE_DESCRIPTOR*)&NodeDescriptor,
244 DEFINE_KSFILTER_DEFAULT_CONNECTIONS,
245 NULL
246};
247
248const
249KSFILTER_DESCRIPTOR *
251{
252 (const KSFILTER_DESCRIPTOR *)&FilterDescriptor
253};
254
255const
256KSDEVICE_DESCRIPTOR
258{
259 NULL, //no pnp notifications needed
260 1, // filter descriptor count
261 (const KSFILTER_DESCRIPTOR * const *)&FilterDescriptors,
262 0, // pre KSDEVICE_DESCRIPTOR_VERSION
263 0
264};
265
266
268NTAPI
271 PUNICODE_STRING RegistryPathName)
272{
273 return KsInitializeDriver(DriverObject, RegistryPathName, &DeviceDescriptor);
274}
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
DRIVER_INITIALIZE DriverEntry
Definition: condrv.c:21
KSDDKAPI NTSTATUS NTAPI KsInitializeDriver(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath, IN const KSDEVICE_DESCRIPTOR *Descriptor OPTIONAL)
Definition: driver.c:155
NTSTATUS NTAPI FilterProcess(IN PKSFILTER Filter, IN PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex)
Definition: filter.c:13
NTSTATUS NTAPI PinIntersectHandler(IN PVOID Context, IN PIRP Irp, IN PKSP_PIN Pin, IN PKSDATARANGE DataRange, IN PKSDATARANGE MatchingDataRange, IN ULONG DataBufferSize, OUT PVOID Data OPTIONAL, OUT PULONG DataSize)
Definition: pin.c:179
NTSTATUS NTAPI AudioPositionPropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
Definition: pin.c:127
NTSTATUS NTAPI PinClose(IN PKSPIN Pin, IN PIRP Irp)
Definition: pin.c:60
NTSTATUS NTAPI PinCreate(IN PKSPIN Pin, IN PIRP Irp)
Definition: pin.c:13
NTSTATUS NTAPI PinState(IN PKSPIN Pin, IN KSSTATE ToState, IN KSSTATE FromState)
Definition: pin.c:99
VOID NTAPI PinReset(IN PKSPIN Pin)
Definition: pin.c:76
struct KSIDENTIFIER KSPROPERTY
_In_ PKSALLOCATOR_FRAMING AllocatorFraming
Definition: ks.h:4518
union KSDATAFORMAT KSDATARANGE
#define STATIC_GUID_NULL
Definition: ks.h:103
@ KSPIN_DATAFLOW_IN
Definition: ks.h:1249
@ KSPIN_DATAFLOW_OUT
Definition: ks.h:1250
@ KSPIN_COMMUNICATION_BOTH
Definition: ks.h:1257
#define STATIC_KSMEMORY_TYPE_KERNEL_PAGED
Definition: ks.h:113
#define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE
Definition: ks.h:1687
@ KSPROPERTY_AUDIO_POSITION
Definition: ksmedia.h:1058
#define STATIC_KSCATEGORY_AUDIO_SPLITTER
Definition: ksmedia.h:229
#define STATIC_KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:980
#define STATIC_KSCATEGORY_AUDIO
Definition: ksmedia.h:169
#define FILE_64_BYTE_ALIGNMENT
Definition: nt_native.h:792
const GUID GUID_NULL
Definition: splitter.c:15
const GUID KSPROPSETID_Audio
Definition: splitter.c:12
KSPROPERTY_ITEM PinPropertyTable[]
Definition: splitter.c:19
const GUID KSNAME_Filter
Definition: splitter.c:14
KSDATARANGE PinDataFormatRange
Definition: splitter.c:92
const KSFILTER_DESCRIPTOR FilterDescriptor
Definition: splitter.c:229
const GUID PIN_VIDEO_CAPTURE
Definition: splitter.c:11
const KSFILTER_DISPATCH FilterDispatch
Definition: splitter.c:83
const KSPROPERTY_SET PinPropertySet[]
Definition: splitter.c:37
const PKSDATARANGE PinDataFormatRanges[]
Definition: splitter.c:107
const KSFILTER_DESCRIPTOR * FilterDescriptors
Definition: splitter.c:250
const KSNODE_DESCRIPTOR NodeDescriptor[]
Definition: splitter.c:217
const GUID Categories[]
Definition: splitter.c:208
const KSDEVICE_DESCRIPTOR DeviceDescriptor
Definition: splitter.c:257
const KSPIN_DISPATCH PinDispatch
Definition: splitter.c:66
const GUID KSCATEGORY_AUDIO_SPLITTER
Definition: splitter.c:13
const KSAUTOMATION_TABLE PinAutomation
Definition: splitter.c:51
const KSPIN_DESCRIPTOR_EX PinDescriptors[]
Definition: splitter.c:154
#define MAXULONG
Definition: typedefs.h:251
#define NTAPI
Definition: typedefs.h:36
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213