Utility functions for reading video frames from a file to the buffer structure and for writing from the buffer structure to a file.
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_fd | DMABUF FD of buffer. |
[in] | plane | video frame plane. |
[in] | stream | A 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] | stream | A pointer to the input recon file stream. |
[in] | string | pointer An array 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] | stream | A pointer to the input file stream. |
[in] | buffer | A 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] | stream | A pointer to the output file stream. |
[in] | buffer | A reference to the buffer object from which the data are written. |
- Returns
- 0 for success, -1 otherwise.