Jetson Linux Multimedia API Reference

32.4.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Video Read/Write

Detailed Description

Utility functions for reading video frames from a file to the buffer structure and for writing from the buffer structure to a file.

Functions

int read_video_frame (std::ifstream *stream, NvBuffer &buffer)
 Reads a video frame from a file to the buffer structure. More...
 
int write_video_frame (std::ofstream *stream, NvBuffer &buffer)
 Writes a video frame from the buffer structure to a file. More...
 
int dump_dmabuf (int dmabuf_fd, unsigned int plane, std::ofstream *stream)
 Writes a plane data of the buffer to a file. More...
 
int parse_csv_recon_file (std::ifstream *stream, std::string *recon_params)
 Parses the reference recon file to write Y, U and V checksum. More...
 

Function Documentation

int dump_dmabuf ( int  dmabuf_fd,
unsigned int  plane,
std::ofstream *  stream 
)

Writes a plane data of the buffer to a file.

This function writes data to the file from a plane of the buffer.

Parameters
[in]dmabuf_fdDMABUF FD of buffer.
[in]planevideo frame plane.
[in]streamA pointer to the output file stream.
Returns
0 for success, -1 otherwise.
int parse_csv_recon_file ( std::ifstream *  stream,
std::string *  recon_params 
)

Parses the reference recon file to write Y, U and V checksum.

This function parses Y, U and V checksums from the reference recon file While returning the Y, U and V filled string array it reads:

Parameters
[in]streamA pointer to the input recon file stream.
[in]recon_paramsA pointer to an array in which to store the parsed Y, U and V strings.
Returns
0 for success, -1 otherwise.
int read_video_frame ( std::ifstream *  stream,
NvBuffer buffer 
)

Reads a video frame from a file to the buffer structure.

This function reads data from the file into the buffer plane-by-plane. While taking care of the stride of the plane, for each data plane it reads:

width * height * byteperpixel
Parameters
[in]streamA pointer to the input file stream.
[in]bufferA reference to the buffer object into which the data are read.
Returns
0 for success, -1 otherwise.
int write_video_frame ( std::ofstream *  stream,
NvBuffer buffer 
)

Writes a video frame from the buffer structure to a file.

This function writes data to the file from the buffer plane-by-plane. While taking care of the stride of the plane, for each data plane it reads:

width * height * byteperpixel
Parameters
[in]streamA pointer to the output file stream.
[in]bufferA reference to the buffer object from which the data are written.
Returns
0 for success, -1 otherwise.