Class vart::VideoFrame#

class VideoFrame

This module simplifies the management of frame memory complexities and provides APIs for reading and writing a frame.

The VideoFrame class offers flexibility for applications to encapsulate their own memory into the VideoFrame class. In such instances, the application bears the responsibility for deallocating the frame memory.

Public Functions

VideoFrame(VideoFrameImplType type, size_t size, uint8_t mbank_idx, VideoInfo &vinfo, std::shared_ptr<Device> device)#

VideoFrame() - Constructor for creating video frame instance using implementation specific method based on input ‘type’.

Parameters:
  • type – Enum class to specify which type of memory allocation method to use

  • size – Size of the buffer

  • mbank_idx – memory bank index on which memory needss to be allocated

  • vinfo – VideoInfo instance which contains video frame specific information

  • deviceDevice handle to be used by implementation

VideoFrame(VideoFrameImplType type, std::vector<uint8_t*> &data_vec, VideoInfo &vinfo, std::shared_ptr<Device> device)#

VideoFrame() - Constructor for creating video frame instance using input data pointers.

Parameters:
  • type – Enum class to specify which type of memory allocation method to use

  • data_vec – Vector of user allocated buffer pointers

  • vinfo – VideoInfo instance which contains video frame specific information

  • deviceDevice handle to be used by implementation

VideoFrame(VideoFrameImplType type, uint8_t mbank_idx, std::vector<xrt::bo*> &bo_vec, VideoInfo &vinfo, std::shared_ptr<Device> device)#

VideoFrame() - Constructor for creating video frame instance using input XRT Buffer object(BO)

Parameters:
  • type – Enum class to specify which type of memory allocation method to use

  • mbank_idx – memory bank index on which memory was allocated

  • bo_vec – Vector of XRT BOs allocated by user

  • vinfo – VideoInfo instance which contains video frame specific information

  • deviceDevice handle to be used by implementation

~VideoFrame() = default#
const VideoFrameMapInfo &map(DataMapFlags map_flags)#

map() - Maps video frame data to user space

Parameters:

map_flags – Flag used to indicate mode of memory mapping

Returns:

Returns information containing user space data pointer(s) and its corresponding video frame information.

void unmap()#

unmap() - Unmaps video frame data from user space

const VideoInfo &get_video_info() const#

get_video_info() - Retrieves the video frame information from video frame

Returns:

Returns infomation related to video frame

std::shared_ptr<Device> get_device_handle() const#

get_device_handle() - Retrieves the device handle associated with the current frame

const std::shared_ptr<VideoFrameImplBase> &get_pimpl_handle() const#

get_pimpl_handle() - Retrieves pointer to implementation class.

Returns:

Returns a constant reference of pointer to implementation class.

Private Members

std::shared_ptr<VideoFrameImplBase> pimpl#