ReactOS 0.4.15-dev-8058-ga7cbb60
filter.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/filter.c
5 * PURPOSE: Filter File Context Handling
6 * PROGRAMMER: Johannes Anderwald
7 */
8
9#include "precomp.h"
10
14 IN PKSFILTER Filter,
15 IN PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex)
16{
18 PKSPROCESSPIN CurPin, Pin;
19 BOOLEAN PendingFrames = FALSE;
20
21 if (ProcessPinsIndex->Count)
22 {
23 /* check if there are outstanding frames */
24 for(Index = 1; Index < ProcessPinsIndex->Count; Index++)
25 {
26 /* get current pin */
27 CurPin = ProcessPinsIndex->Pins[Index];
28
29 if (CurPin->BytesAvailable && CurPin->Pin->DeviceState == KSSTATE_RUN)
30 {
31 /* pin has pending frames
32 * to keep all pins synchronized, every pin has to wait untill each chained pin has send its frames downwards
33 */
34 PendingFrames = TRUE;
35 }
36 }
37 }
38
39 if (!PendingFrames && ProcessPinsIndex->Count)
40 {
41 /* get first pin */
42 Pin = ProcessPinsIndex->Pins[0];
43
44 /* check if there is new data available */
45 if (Pin->BytesAvailable)
46 {
47 for(Index = 1; Index < ProcessPinsIndex->Count; Index++)
48 {
49 /* get current pin */
50 CurPin = ProcessPinsIndex->Pins[Index];
51
52 /* copy the frame to pin */
53 RtlMoveMemory(CurPin->Data, Pin->Data, Pin->BytesAvailable);
54 CurPin->BytesUsed = Pin->BytesAvailable;
55 }
56 }
57 }
58 /* done */
59 return STATUS_SUCCESS;
60}
61
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
NTSTATUS NTAPI FilterProcess(IN PKSFILTER Filter, IN PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex)
Definition: filter.c:13
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
_Must_inspect_result_ _In_opt_ PFLT_FILTER Filter
Definition: fltkernel.h:1801
struct _KSPROCESSPIN_INDEXENTRY * PKSPROCESSPIN_INDEXENTRY
Definition: ks.h:3028
@ KSSTATE_RUN
Definition: ks.h:1218
#define STATUS_SUCCESS
Definition: shellext.h:65
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index