Frame sink concepts

This chapter describes the concepts behind the sink classes provided by the library.

Introduction

The class library contains 4 major frame sinks.

FrameNotificatonSink

If you need a stream of images to do operations on, this is a easy and efficient way to get that. The FrameNotificationSinkListener::frameReceived provides access to the images in the image stream. This image can now be copyied to the actual destination needed.

Because the FrameNotificationSinkListener::frameReceived callback gets called in the thread context of the driver, frames get dropped when you take too much time for your operation (or your thread gets scheduled out). Most drivers implement some buffering, but you cannot control the buffering done by the driver itself, so you can easily drop several frames when you are not keeping up.

So when you must either see every frame in a image stream or must look into the past better use the FrameQueueSink.

FrameQueueSink

If you need a constant un-interrupted stream of images and to have to get (almost) all frames. You should use the FrameQueueSink. This sink contains 2 queues of FrameQueueBuffers to buffer variance in execution time of your algorithms.

The FrameQueueSink with its FrameQueueBuffer derived frames allows you to hold onto a buffer until you do not need it anymore. And you can return this buffer via FrameQueueSink::queueBuffer back into the sink itself. The amount of FrameQueueBuffers available controls the amount of time your operation can lag behind the image stream before the FrameQueueSink drops images.

FrameSnapSink

The FrameSnapSink can be used to get simple access to the next N frames.

<< Technical Articles