ReactOS  0.4.15-dev-3163-gf17c2c0
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 {
17  ULONG Index;
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 }
#define TRUE
Definition: types.h:120
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:424
_In_ WDFCOLLECTION _In_ ULONG Index
unsigned int ULONG
Definition: retypes.h:1
#define STATUS_SUCCESS
Definition: shellext.h:65