#include <stdio.h>#include <stdlib.h>#include <string.h>#include "shared_memory_image_client.h"#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#include <sys/mman.h>#include <pthread.h>#include <unistd.h>Go to the source code of this file.
Macros
Functions
Detailed Description
C API the shared memory image transport API server interface. Version 1.0 This file describes the internal format of the shared memory system and the inner workings of the buffer state machine. It also provides the interface to a shared memory image server.When creating a shared memory transport server, the shared_memory_image_client.h interface is used to create/destroy a stream, albeit with unique option flags. The server does not use the SharedMemoryImageStream_lock() / SharedMemoryImageStream_unlock() functions. Instead, it calls SharedMemoryImageStream_putframe() whenever it has new imagery it wants to push to the client. Server operations are as follows:
- The client creates/sizes the shared memory file that is to be used and passes the filename to the server.
-
The server creates/initializes the shared memory stream by calling SharedMemoryImageStream_create() with the IMAGESTREAM_OPTIONS_SERVER option.
-
Periodically, the server may push a new image:
The data passed via buffer is copied into the shared memory space. Note, in some conditions, this function does not return a fatal error (<0), instead the error code return can report that no client has made a connection or that the frame was dropped because the client has not been responding to the frames being pushed fast enough.
-
When the communication is finished, the server should call:
Macro Definition Documentation
IMAGESTREAM_OPTIONS_INITBUFFERHEADERS
IMAGESTREAM_OPTIONS_NOTHREADS
IMAGESTREAM_OPTIONS_SERVER
Function Documentation
SharedMemoryImageStream_putframe()
Returns
SharedMemoryImageError - the return code for the operation