ReactOS  0.4.14-dev-554-g2f8d847
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 
11 const GUID PIN_VIDEO_CAPTURE = {0xfb6c4281, 0x0353, 0x11d1, {0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba}};
12 const GUID KSPROPSETID_Audio = {0x45FFAAA0, 0x6E1B, 0x11D0, {0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}};
13 const GUID KSCATEGORY_AUDIO_SPLITTER = {0x9EA331FA, 0xB91B, 0x45F8, {0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE}};
14 const GUID KSNAME_Filter = {0x9b365890, 0x165f, 0x11d0, {0xa1, 0x95, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}};
15 const GUID GUID_NULL = {0x00000000, 0x0000, 0x0000, {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}};
16 
17 
18 KSPROPERTY_ITEM
20 {
21  {
24  sizeof(KSPROPERTY),
25  sizeof(KSAUDIO_POSITION),
27  NULL,
28  0,
29  NULL,
30  NULL,
31  0
32  }
33 };
34 
35 const
36 KSPROPERTY_SET
38 {
39  {
41  1,
43  0,
44  NULL
45  }
46 };
47 
48 
49 const
50 KSAUTOMATION_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 
64 const
65 KSPIN_DISPATCH
67 {
68  PinCreate,
69  PinClose,
70  NULL, /* filter centric processing */
71  PinReset,
72  NULL,
73  PinState,
74  NULL,
75  NULL,
76  NULL,
77  NULL
78 };
79 
80 
81 const
82 KSFILTER_DISPATCH
84 {
85  NULL,
86  NULL,
88  NULL
89 };
90 
93 {
94  {
95  sizeof(KSDATARANGE),
96  0,
97  0,
98  0,
102  }
103 };
104 
105 const
108 {
110 };
111 
112 #if 0
113 const
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 
152 const
153 KSPIN_DESCRIPTOR_EX
155 {
156  {
157  &PinDispatch,
158  &PinAutomation,
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  {
182  &PinDispatch,
183  &PinAutomation,
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 };
206 const
207 GUID
209 {
212 };
213 
214 
215 const
216 KSNODE_DESCRIPTOR
218 {
219  {
220  NULL, //automation table
222  NULL // name
223  }
224 };
225 
226 
227 const
228 KSFILTER_DESCRIPTOR
230 {
232  NULL,
233  KSFILTER_DESCRIPTOR_VERSION,
234  KSFILTER_FLAG_DISPATCH_LEVEL_PROCESSING,
235  &KSNAME_Filter,
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 
248 const
249 KSFILTER_DESCRIPTOR *
251 {
252  (const KSFILTER_DESCRIPTOR *)&FilterDescriptor
253 };
254 
255 const
256 KSDEVICE_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 
267 NTSTATUS
268 NTAPI
271  PUNICODE_STRING RegistryPathName)
272 {
273  return KsInitializeDriver(DriverObject, RegistryPathName, &DeviceDescriptor);
274 }
struct KSIDENTIFIER KSPROPERTY
NTSTATUS NTAPI PinClose(IN PKSPIN Pin, IN PIRP Irp)
Definition: pin.c:60
const KSFILTER_DESCRIPTOR FilterDescriptor
Definition: splitter.c:229
const GUID GUID_NULL
Definition: splitter.c:15
union KSDATAFORMAT KSDATARANGE
#define STATIC_KSCATEGORY_AUDIO
Definition: ksmedia.h:169
const GUID KSNAME_Filter
Definition: splitter.c:14
#define FILE_64_BYTE_ALIGNMENT
Definition: nt_native.h:792
LONG NTSTATUS
Definition: precomp.h:26
_In_ PKSALLOCATOR_FRAMING AllocatorFraming
Definition: ks.h:4518
NTSTATUS NTAPI AudioPositionPropertyHandler(IN PIRP Irp, IN PKSIDENTIFIER Request, IN OUT PVOID Data)
Definition: pin.c:127
#define STATIC_GUID_NULL
Definition: ks.h:103
const KSAUTOMATION_TABLE PinAutomation
Definition: splitter.c:51
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID NTAPI PinReset(IN PKSPIN Pin)
Definition: pin.c:76
const GUID Categories[]
Definition: splitter.c:208
smooth NULL
Definition: ftsmooth.c:416
const KSPROPERTY_SET PinPropertySet[]
Definition: splitter.c:37
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
const GUID KSCATEGORY_AUDIO_SPLITTER
Definition: splitter.c:13
const KSDEVICE_DESCRIPTOR DeviceDescriptor
Definition: splitter.c:257
#define STATIC_KSCATEGORY_AUDIO_SPLITTER
Definition: ksmedia.h:229
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
#define STATIC_KSDATAFORMAT_TYPE_AUDIO
Definition: ksmedia.h:880
const KSPIN_DISPATCH PinDispatch
Definition: splitter.c:66
const KSNODE_DESCRIPTOR NodeDescriptor[]
Definition: splitter.c:217
const KSFILTER_DISPATCH FilterDispatch
Definition: splitter.c:83
#define KSALLOCATOR_REQUIREMENTF_MUST_ALLOCATE
Definition: ks.h:1687
const GUID PIN_VIDEO_CAPTURE
Definition: splitter.c:11
#define MAXULONG
Definition: typedefs.h:250
NTSTATUS NTAPI PinState(IN PKSPIN Pin, IN KSSTATE ToState, IN KSSTATE FromState)
Definition: pin.c:99
NTSTATUS NTAPI FilterProcess(IN PKSFILTER Filter, IN PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex)
Definition: filter.c:13
NTSTATUS NTAPI PinCreate(IN PKSPIN Pin, IN PIRP Irp)
Definition: pin.c:13
KSDDKAPI NTSTATUS NTAPI KsInitializeDriver(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath, IN const KSDEVICE_DESCRIPTOR *Descriptor OPTIONAL)
Definition: driver.c:155
KSDATARANGE PinDataFormatRange
Definition: splitter.c:92
const KSPIN_DESCRIPTOR_EX PinDescriptors[]
Definition: splitter.c:154
const GUID KSPROPSETID_Audio
Definition: splitter.c:12
#define STATIC_KSMEMORY_TYPE_KERNEL_PAGED
Definition: ks.h:113
KSPROPERTY_ITEM PinPropertyTable[]
Definition: splitter.c:19
NTSTATUS NTAPI DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPathName)
Definition: splitter.c:269
const KSFILTER_DESCRIPTOR * FilterDescriptors
Definition: splitter.c:250
const PKSDATARANGE PinDataFormatRanges[]
Definition: splitter.c:107