ReactOS 0.4.15-dev-8339-g4028de8
filter.c File Reference
#include "precomp.h"
Include dependency graph for filter.c:

Go to the source code of this file.

Functions

NTSTATUS NTAPI FilterProcess (IN PKSFILTER Filter, IN PKSPROCESSPIN_INDEXENTRY ProcessPinsIndex)
 

Function Documentation

◆ FilterProcess()

NTSTATUS NTAPI FilterProcess ( IN PKSFILTER  Filter,
IN PKSPROCESSPIN_INDEXENTRY  ProcessPinsIndex 
)

Definition at line 13 of file filter.c.

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}
unsigned char BOOLEAN
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
@ KSSTATE_RUN
Definition: ks.h:1218
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFCOLLECTION _In_ ULONG Index