1 Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
3 @page l4t_mm_decoder_unit_sample_group decoder_unit_sample
6 - [Overview](#overview)
7 - [Building and Running](#build_and_run)
9 - [Key Structure and Classes](#key)
12 - - - - - - - - - - - - - - -
16 The decode_sample application is a unit level implementation that
17 demonstrates how to use the buffer
18 allocated by the `libv4l2` component to decode H.264 video streams.
20 The application reads an H.264 elementary
21 video file, decodes it, and writes the raw YUV buffer into a file
22 without any extra memory copy.
24 Supported video formats are:
27 <a name=
"build_and_run">
28 - - - - - - - - - - - - - - -
29 ## Building and Running ##
32 * You have followed steps 1-3 in @ref mmapi_build.
33 * If you are building from your host Linux PC (x86), you have followed
34 step 4 in @ref mmapi_build.
39 $ cd $HOME/multimedia_api/samples/unittest_samples/decoder_unit_sample
45 $ ./decode_sample <in-file> <out-file>
49 $ ./decode_sample ../../data/Video/sample_outdoor_car_1080p_10fps.h264 out_sample_outdoor_car_1080p_10fps.yuv
53 - - - - - - - - - - - - - - -
55 The following steps show the flow through
this sample.
57 -# The decoder instance is created.
59 -# @b Output @b Plane and @b Capture @b Plane are set up.
60 -# External controls are set.
61 -# The @b Output @b Plane receives input in bitstream format and delivers it
62 to the @b Decoder
for decoding.
63 -# The @b Capture @b Plane transfers decoded frames to the application
65 -# For the @b Output @b Plane the application supports MMAP
66 memory type. For the @b Capture @b Plane it supports DMABUF memory type.
67 -# The application takes decoded buffers from @b Capture @b Plane and dumps into a file.
71 - - - - - - - - - - - - - - -
72 ## Key Structure and Classes ##
74 The sample uses the following key
class:
76 | Element | Description |
77 | ---------------- | ----------- |
78 | Buffer | Class modeled on v4l2_buffer structure. |
80 The key structures and functions used in the sample are:
82 | Function | Description |
83 | ---------------- | ----------- |
84 | decode_process | Function loop to DQ and EnQ buffers on output plane till eos is signalled. |
85 | capture_thread | A pointer to the thread handler
for the decoding capture loop. |
86 | dq_event | Function to dequeue an
event. |
87 | dq_buffer | Function to dequeue a buffer from the plane. |
88 | q_buffer | Function to queue a buffer on the plane. |
89 | req_buffers_on_capture_plane | Function to request
for buffers on the decoder capture plane. |
90 | req_buffers_on_output_plane | Function to request
for buffers on the decoder output plane. |
91 | set_capture_plane_format | Function to set the format on the decoder capture plane. |
92 | set_output_plane_format | Function to set the format on the decoder output plane. |
93 | set_ext_controls | Function to set the value of controls. |
94 | subscribe_event | Function to subscribes to a V4L2
event. |
#define V4L2_EVENT_RESOLUTION_CHANGE
Defines the V4L2 event type for decoder resolution event change.