The NVIDIA buffering utility, nvbuf_utils provide a wrapper to simplify the use case of applications/plugins for buffering and transform, composite, or blending.
The transform unit sample demonstrates the use of nvbuf_utils for conversion from one pixel-format to another. Supported pixel formats, filters, composites and other properties are described in the nvbuf_utils.
Supported pixel formats are:
$ cd /usr/src/jetson_multimedia_api/samples/unittest_samples/transform_unit_sample $ make
$ ./transform_sample <in-file> <in-pix-fmt> <in-width> <in-height> <out-file> <out-pixfmt>
Enter:
$ ./transform_sample --help
$ ./transform_sample ../../data/Video/sample_outdoor_car_1080p_10fps.yuv yuv420 1920 1080 sample_outdoor_car_1080p_10fps_nv12.yuv nv12
The following steps show the flow through this sample.
The sample uses the nvbuf_utils functions:
Element | Description |
---|---|
NvBufferMemMap | Gets mem mapped virtual Address of the plane. |
NvBufferMemUnMap | Unmaps mapped virtual Address of the plane. |
NvBufferGetParams | Gets the buffer parameters. |
NvBufferCreateEx | Allocates a hardware buffer. |
NvBufferMemSyncForCpu | Syncs hw memory cache for the CPU. |
NvBufferMemSyncForDevice | Syncs hw memory cache for the device. |
NvBufferTransform | Transforms one DMA buffer to another DMA buffer. |
NvBufferDestroy | Destroys hw buffer. |