Example Programs

Václav Procházka

SMInterface

Example programs

To demonstrate usage of SMInterface, we have prepared 2 example projects - Sender and Shower. Both projects should be built into examples directory, source files are in examples/src. It is recommended to look upon their sources to understand the usage of SMInterface. For more details see the source codes of example files, they are commented in a way that You should understand them.

Sender

Program Sender creates an instance of SMInterface, opens one or more videofiles and creates an image queue in shared memory for each of the input videofiles. Then it uses OpenCV to grab frames from the videos and stores the frames as images in the created queues in shared memory. It also creates a float vector queue and in a loop it pushes into the queue the current time information in milliseconds. The Sender program is recommended to start before the Shower and gets terminated by SIGINT signal (Ctrl-C in console).

Shower

Program Shower opens the shared memory created by Sender and reads and displays the data from the queues, using stdout for float vectors output and OpenCV windows to show the loaded images. The program gets terminated by pressing Esc button in one of the windows showing the videos, and should be terminated before the Sender.




Screenshots

Transferring 1 videofile in original resolution
Transferring 1 videofile through SMInterface

Transferring 2 videofiles with adjusted resolution
Transferring 2 videofiles (with adjusted resolution) through SMInterface


MongoDB Logo MongoDB