Crate videostream_sys

Source

Re-exports§

pub use self::vsl_encode_profile as VSLEncoderProfile;

Structs§

vsl_camera
vsl_camera_buffer
vsl_client
vsl_decoder
vsl_encoder
vsl_frame
vsl_host
vsl_rect
The VSLRect structure represents a rectangle region of a frame and is used to define cropping regions for sub-frames.

Constants§

VSLDecoderRetCode_VSL_DEC_ERR
VSLDecoderRetCode_VSL_DEC_FRAME_DEC
VSLDecoderRetCode_VSL_DEC_INIT_INFO
VSLDecoderRetCode_VSL_DEC_SUCCESS
vsl_encode_profile_VSL_ENCODE_PROFILE_5000_KBPS
vsl_encode_profile_VSL_ENCODE_PROFILE_25000_KBPS
vsl_encode_profile_VSL_ENCODE_PROFILE_50000_KBPS
vsl_encode_profile_VSL_ENCODE_PROFILE_100000_KBPS
vsl_encode_profile_VSL_ENCODE_PROFILE_AUTO

Functions§

vsl_camera_buffer_dma_fd
Returns the dmabuf file descriptor of the camera buffer
vsl_camera_buffer_fourcc
Returns the fourcc code of the camera buffer
vsl_camera_buffer_length
Returns the length of the camera buffer in bytes
vsl_camera_buffer_mmap
Returns the mmap memory of the camera buffer
vsl_camera_buffer_phys_addr
Returns the phys addr of the camera buffer
vsl_camera_buffer_timestamp
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.
vsl_camera_close_device
Closes the camera device and frees the device memory
vsl_camera_enum_fmts
Lists the supported single planar formats of the camera into @param codes as fourcc codes
vsl_camera_enum_mplane_fmts
Lists the supported multi planar formats of the camera into @param codes as fourcc codes
vsl_camera_get_data
Attempts to read a frame from the camera.
vsl_camera_get_queued_buf_count
Returns the number of queued buffers for the camera. @ref vsl_camera_get_data will timeout if there are 0 queued buffers.
vsl_camera_init_device
Initialized the camera device in @param ctx for streaming and allocate camera buffers.
vsl_camera_is_dmabuf_supported
Checks if dma buffers are supported on the camera
vsl_camera_mirror
Requests the camera in @param ctx to mirror the image leftside right
vsl_camera_mirror_v
Requests the camera in @param ctx to mirror the image upside down
vsl_camera_open_device
Opens the camera device specified by the @param filename and allocates device memory. If the device was not found or could not be recognized
vsl_camera_release_buffer
Enqueues a buffer to be reused for frame capture.
vsl_camera_start_capturing
Starts the camera stream.
vsl_camera_stop_capturing
Stops the camera stream.
vsl_camera_uninit_device
Uninitializes the camera buffers and frees the buffer memory
vsl_client_disconnect
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.
vsl_client_init
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.
vsl_client_path
Returns the path on which the client has connected to the host.
vsl_client_release
Releases the client, disconnecting from the host and releasing allocated memory.
vsl_client_set_timeout
Sets the socket timeout for this client.
vsl_client_userptr
Returns the optional userptr associated with this client connection.
vsl_decode_frame
vsl_decoder_create
vsl_decoder_crop
vsl_decoder_height
vsl_decoder_release
vsl_decoder_width
vsl_encode_frame
@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)
vsl_encoder_create
@brief Creates VSLEncoder instance
vsl_encoder_new_output_frame
vsl_encoder_release
@brief Destroys VSLEncoder instance
vsl_fourcc_from_string
Returns a fourcc integer code from the string. If the fourcc code is invalid or unsupported then 0 is returned.
vsl_frame_alloc
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.
vsl_frame_attach
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.
vsl_frame_copy
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.
vsl_frame_dts
Returns the decode timestamp for this frame in nanoseconds.
vsl_frame_duration
Returns the duration for this frame in nanoseconds.
vsl_frame_expires
Returns the epiration time for this frame in milliseconds.
vsl_frame_fourcc
Returns the FOURCC code for the video frame.
vsl_frame_handle
Returns the file descriptor for this frame or -1 if none is associated.
vsl_frame_height
Returns the height in pixels of the video frame.
vsl_frame_init
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().
vsl_frame_mmap
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().
vsl_frame_munmap
Maps the frame into the process’ memory space, optionally also sets the size of the frame if @param size is non-NULL.
vsl_frame_paddr
Returns the physical address of the frame. If the frame does not support DMA then MMAP_FAILED is returned.
vsl_frame_path
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.
vsl_frame_pts
Returns the presentation timestamp for this frame in nanoseconds.
vsl_frame_register
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.
vsl_frame_release
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.
vsl_frame_serial
Returns the serial frame count of the video frame.
vsl_frame_set_userptr
Associate userptr with this frame.
vsl_frame_size
Returns the size in bytes of the video frame.
vsl_frame_stride
Returns the stride in bytes of the video frame, to go from one row to the next.
vsl_frame_sync
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.
vsl_frame_timestamp
Returns the timestamp for this frame in nanoseconds.
vsl_frame_trylock
Attempts to lock the video frame.
vsl_frame_unalloc
Frees the allocated buffer for this frame. Does not release the frame itself for that use @ref vsl_frame_release().
vsl_frame_unlock
Attempts to unlock the video frame.
vsl_frame_unregister
Unregisters the frame, removing it from the host pool.
vsl_frame_userptr
Returns the user pointer associated with this frame.
vsl_frame_wait
Waits for a frame to arrive and returns a new frame object. Frames who’s timestamp is less than @param until will be ignored.
vsl_frame_width
Returns the width in pixels of the video frame.
vsl_host_drop
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.
vsl_host_init
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.
vsl_host_path
Returns the bound path of the host.
vsl_host_poll
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.
vsl_host_post
Registers the frame with the host and publishes it to subscribers.
vsl_host_process
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.
vsl_host_release
Releases the host, disconnecting all clients and releasing any allocated memory.
vsl_host_service
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.
vsl_host_sockets
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.
vsl_timestamp
vsl_version
Returns the VideoStream Library version.

Type Aliases§

VSLClient
The VSLClient object manages a single connection to a VSLHost.
VSLDecoder
The VSLEncoder object represents encoder instance.
VSLDecoderRetCode
VSLEncoder
The VSLEncoder object represents encoder instance.
VSLFrame
The VSLFrame object represents a single video frame from either the host or client perspective. Certain API are only available to the host or client.
VSLHost
The VSLHost object manages a connection point at the user-defined path and allows frames to be registered for client use.
VSLRect
The VSLRect structure represents a rectangle region of a frame and is used to define cropping regions for sub-frames.
vsl_encode_profile
vsl_frame_cleanup
Function pointer definition which will be called as part of @ref vsl_frame_unregister. This is typically used to free resources associated with the frame on either client or host side.