4. VideoProcessor

Manages the processing of VideoStream’s buffered frames through the use of FrameFilters to transform image frames in real-time.

Available implementations:

  • ParallelVideoProcessor - follows a parallel processing model to process image frames in parallel to make sure they are processed as fast as possible.
  • SerialVideoProcessor - doesn’t use any parallel processing model to process image frames and is executed in the same execution context as the pipeline.

4.1. ParallelVideoProcessor

This parallel processing model is achieved by spawning a series of frame processors (denoted in the diagram below as F1, F2, and F3) which utilize the FrameFilter that is provided to the VideoProcessor to handle the filter logic of a single image frame.

VideoProcessor

After an image frame has processed the image frame processor iterates through the currently executing image frame processors to see if we can buffer any processed image frames that might be ahead of us. If a completed frame processor is found it’s processed image frame is put into the frame buffer. We repeat this process until we run into a frame processor that hasn’t been completed or we run out of frame processors to check. The frame buffer is then later pulled by the pipeline for transport.

4.2. SerialVideoProcessor

Nothing unique. Puts frames to process in a queue that is subsequently processed by the pipeline’s execution context.

After an image frame has processed the pipeline takes the processed image frame immediately.