Returns the dmabuf file descriptor of the camera buffer
Returns the fourcc code of the camera buffer
Returns the length of the camera buffer in bytes
Returns the mmap memory of the camera buffer
Returns the phys addr of the camera buffer
Reads the timestamp of the camera buffer into @param seconds and @param
nanoseconds. The seconds are relative to the monotonic time when the frame
was captured, nanoseconds are the sub-seconds in nanoseconds.
Closes the camera device and frees the device memory
Lists the supported single planar formats of
the camera into @param codes as fourcc codes
Lists the supported multi planar formats of
the camera into @param codes as fourcc codes
Attempts to read a frame from the camera.
Returns the number of queued buffers for the camera.
@ref vsl_camera_get_data will timeout if there are 0 queued buffers.
Initialized the camera device in @param ctx for streaming
and allocate camera buffers.
Checks if dma buffers are supported on the camera
Requests the camera in @param ctx to mirror the image leftside right
Requests the camera in @param ctx to mirror the image upside down
Opens the camera device specified by the @param filename and allocates
device memory. If the device was not found or could not be recognized
Enqueues a buffer to be reused for frame capture.
Starts the camera stream.
Stops the camera stream.
Uninitializes the camera buffers and frees the buffer memory
Disconnects from the VSLHost and stops all reconnection attempts. This
should be called as part of closing down a VSL client session. It is
thread-safe unlike vsl_client_release which disposes of the client object.
Creates a client and connects to the host at the provided path. If the
connection cannot be made NULL is returned and errno is set.
Returns the path on which the client has connected to the host.
Releases the client, disconnecting from the host and releasing allocated
memory.
Sets the socket timeout for this client.
Returns the optional userptr associated with this client connection.
@brief Encode frame
@param encoder VSLEncoder instance
@param source VSLFrame source
@param destination VSLFrame destination
@param cropRegion (optional) VSLRect that defines the crop region, NULL when
destination and source sizes match
@param keyframe (optional) VSL sets this to 1 if the encoded frame is a
keyframe, otherwise 0. User can set to NULL to ignore param.
@retval 0 on success
@retval -1 on falure (check errno for details)
@brief Creates VSLEncoder instance
@brief Destroys VSLEncoder instance
Returns a fourcc integer code from the string. If the fourcc code is invalid
or unsupported then 0 is returned.
Allocates the underlying memory for the frame. This function will prefer to
allocate using dmabuf and fallback to shared memory if dmabuf is not
available, unless the frame has a path defined in which case shared memory is
assumed. If the path begins with /dev then it assumed to point to a
dmabuf-heap device. If path is NULL then the allocator will first attempt to
create a dmabuf then fallback to shared memory.
Attach the provided file descriptor to the VSLFrame. If size is not provided
it is assumed to be stride*height bytes. If offset is provided then size
MUST be provided, the offset is in bytes to the start of the frame.
Copy the source frame into the target frame, with optional source crop. The
copy handles format conversion, rescaling to fit the target frame. Resize
happens after the crop, if required.
Returns the decode timestamp for this frame in nanoseconds.
Returns the duration for this frame in nanoseconds.
Returns the epiration time for this frame in milliseconds.
Returns the FOURCC code for the video frame.
Returns the file descriptor for this frame or -1 if none is associated.
Returns the height in pixels of the video frame.
Initializes a VSLFrame without underlying frame buffer. To create the
backing memory either call @ref vsl_frame_alloc() or to attach to an existing
bufer use @ref vsl_frame_attach().
Maps the frame into the process’ memory space, optionally also sets the
size of the frame if @param size is non-NULL. Ensure the frame is
unmapped when no longer needed using @ref nn_frame_munmap().
Maps the frame into the process’ memory space, optionally also sets the
size of the frame if @param size is non-NULL.
Returns the physical address of the frame. If the frame does not support
DMA then MMAP_FAILED is returned.
Returns the path to the underlying VSLFrame buffer. Note it will not always
be available, such as when the frame was externally created. When no path is
available NULL is returned.
Returns the presentation timestamp for this frame in nanoseconds.
Creates and posts the video frame along with optional user pointer to any
arbitrary data. Typically it would be used for holding a reference to
the host’s view of the frame handle.
Releases the frame, performing required cleanup. If the frame was mapped it
will be unmapped. If the frame was posted to a host it will be removed, if
this is a client frame it will be unlocked.
Returns the serial frame count of the video frame.
Associate userptr with this frame.
Returns the size in bytes of the video frame.
Returns the stride in bytes of the video frame, to go from one row to the
next.
Cache synchronization session control for when using DMA-backed buffers.
This happens automatically on mmap/munmap but the API is also available for
cases where the frame is updated in-place during a mapping.
Returns the timestamp for this frame in nanoseconds.
Attempts to lock the video frame.
Frees the allocated buffer for this frame. Does not release the frame itself
for that use @ref vsl_frame_release().
Attempts to unlock the video frame.
Unregisters the frame, removing it from the host pool.
Returns the user pointer associated with this frame.
Waits for a frame to arrive and returns a new frame object. Frames who’s
timestamp is less than @param until will be ignored.
Returns the width in pixels of the video frame.
Drops the frame from the host. This is meant to be called from the frame
but can also be used to remove the host association of the frame and return
ownership to the caller.
Creates a host on the requested path. If the path is unavailable because
of permissions or already exists then NULL is returned and errno is set.
Returns the bound path of the host.
Polls the list of available connections in our pool. If @param wait is >0
then poll will timeout after @param wait milliseconds. Note frames are only
expired by the @ref vsl_host_process function so the @param wait parameter
should be some value no greater than the desired expiration time.
Registers the frame with the host and publishes it to subscribers.
Process the host tasks by first expiring old frames and then servicing the
first available connection in our pool. This function should be called in a
loop, generally blocked by @ref vsl_host_poll.
Releases the host, disconnecting all clients and releasing any allocated
memory.
Services a single client socket. Note this does not accept new sockets for
that you must call @ref vsl_host_process(). The main advantage over calling
this function is to see if individual client servicing resulted in an error.
Request a copy of the sockets managed by the host. There will always be at
least one socket which is the connection socket which accepts new
connections. Up to n_sockets socket descriptors will be copied into the
sockets buffer, if n_sockets is fewer than the number of available sockets
errno will be set to ENOBUFS. The n_socket parameter, if provided, will be
populated with a value of n_clients+1 which can be used to query required
space for the sockets buffer. It is suggested to provide a buffer which is
larger than max_sockets to avoid race conditions where the number of sockets
changes between calls to this function.
Returns the VideoStream Library version.