1 Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 @page l4t_mm_transform_unit_sample_group transform_unit_sample
6 - [Overview](#overview)
7 - [Building and Running](#build_and_run)
9 - [Key Structure and Classes](#key)
12 - - - - - - - - - - - - - - -
16 The NVIDIA buffering utility, [nvbuf_utils](nvbuf__utils_8h_source.html)
17 provide a wrapper to simplify the use
case of applications/plugins
for
18 buffering and rransform, composite or blending.
20 The transform unit sample demonstrates the use of nvbuf_utils
for conversion from
21 one pixel-format to another.
22 Supported pixel formats, filters, composites and other properties are
23 described in the [nvbuf_utils](nvbuf__utils_8h_source.html).
25 Supported pixel formats are:
35 <a name=
"build_and_run">
36 - - - - - - - - - - - - - - -
37 ## Building and Running ##
40 * You have followed steps 1-3 in @ref mmapi_build.
41 * If you are building from your host Linux PC (x86), you have followed
42 step 4 in @ref mmapi_build.
47 $ cd $HOME/multimedia_api/samples/unittest_samples/transform_unit_sample
53 $ ./transform_sample <in-file> <in-pix-fmt> <in-width> <in-height> <out-file> <out-pixfmt>
55 ### To view supported options
58 $ ./transform_sample --help
62 $ ./transform_sample ../../data/Video/sample_outdoor_car_1080p_10fps.yuv
63 yuv420 1920 1080 sample_outdoor_car_1080p_10fps_nv12.yuv nv12
67 - - - - - - - - - - - - - - -
69 The following steps show the flow through
this sample.
71 -# Create input and output DMA mapped hardware buffers.
72 -# Define the transformation parameters.
74 to the output DMA buffer, both exported as fd.
75 -# The application writes the transformed buffer into a file.
79 - - - - - - - - - - - - - - -
80 ## Key Structure and Classes ##
82 The sample uses the [nvbuf_utils](nvbuf__utils_8h_source.html) functions:
84 | Element | Description |
85 | ---------------- | ----------- |
86 | [
NvBufferMemMap](group__ee__nvbuffering__group.html#gab6760a1b12067b32a80e7aa9e2a98d2b) | Gets mem mapped
virtual Address of the plane. |
87 | [
NvBufferMemUnMap](group__ee__nvbuffering__group.html#ga5fd173847091ba84802f8f7e00ffda52) | Unmaps mapped
virtual Address of the plane. |
88 | [
NvBufferGetParams](group__ee__nvbuffering__group.html#gabd39426181a52065586917dfd470fa5a) | Gets the buffer parameters. |
89 | [
NvBufferCreateEx](group__ee__nvbuffering__group.html#ga5d21823c3ab5f07f55ccea64deb01e96
") | Allocates a hardware buffer. |
90 | [NvBufferMemSyncForCpu](group__ee__nvbuffering__group.html#ga8c26b181329a181b41498b06a4f66602) | Syncs hw memory cache for the CPU. |
91 | [NvBufferMemSyncForDevice](group__ee__nvbuffering__group.html#ga4a52fd88a031be9cca774b2c6ff98e4e) | Syncs hw memory cache for the device. |
92 | [NvBufferTransform](group__ee__nvbuffering__group.html#ga6f79642157d9930b43bd6a775a92dca9) | Transforms one DMA buffer to another DMA buffer. |
93 | [NvBufferDestroy](group__ee__nvbuffering__group.html#gab03cbe902e747420f02bb5b509b05968) | Destroys hw buffer. |
int NvBufferMemUnMap(int dmabuf_fd, unsigned int plane, void **pVirtAddr)
Unmaps the mapped virtual address of the plane.
int NvBufferMemMap(int dmabuf_fd, unsigned int plane, NvBufferMemFlags memflag, void **pVirtAddr)
Gets the memory-mapped virtual address of the plane.
int NvBufferTransform(int src_dmabuf_fd, int dst_dmabuf_fd, NvBufferTransformParams *transform_params)
Transforms one DMA buffer to another DMA buffer.
int NvBufferGetParams(int dmabuf_fd, NvBufferParams *params)
Gets buffer parameters.
int NvBufferCreateEx(int *dmabuf_fd, NvBufferCreateParams *input_params)
Allocates a hardware buffer.