Jetson Linux Multimedia API Reference

32.4.3 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
multimedia_api/ll_samples/docs/l4t_mm_jpeg_decode.md
Go to the documentation of this file.
1 Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
2 
3 @page l4t_mm_jpeg_decode 06_jpeg_decode
4 @{
5 
6  - [Overview](#overview)
7  - [Building and Running](#build_and_run)
8  - [Flow](#flow)
9  - [Key Structure and Classes](#key)
10 
11 - - - - - - - - - - - - - - -
12 <a name="overview">
13 ## Overview ##
14 
15 The JPEG decode sample demonstrates JPEG decode and optional use of the lib4L2 conversion API, should buffer format conversion be required.
16 
17 
18 <a name="build_and_run">
19 - - - - - - - - - - - - - - -
20 ## Building and Running ##
21 
22 #### Prerequisites ####
23 * You have followed Steps 1-3 in @ref mmapi_build.
24 * If you are building from your host Linux PC (x86), you have
25  followed Step 4 in @ref mmapi_build.
26 
27 
28 ### To build:
29 * Enter:
30 
31  $ cd $HOME/tegra_multimedia_api/samples/06_jpeg_decode
32  $ make
33 
34 ### To run
35 * Enter:
36 
37  $ ./jpeg_decode num_files <number of files to decode> \
38  <in-file1> <out-file1> ...<in-filen> <out-filen> [OPTIONS]
39 
40 ### Example
41 
42  $ ./jpeg_decode num_files 1 ../../data/Picture/nvidia-logo.jpg ../../data/Picture/nvidia-logo.yuv
43 
44 <a name="flow">
45 - - - - - - - - - - - - - - -
46 ## Flow
47 The following diagram shows the flow of data through the sample.
48 
49 ![](l4t_mm_jpeg_decoder.jpg)
50 
51 #### Additional Details
52 
53 The output plane is used to receive input and the capture plane is used to produce output.
54 When calling [decodeToFd](classNvJPEGDecoder.html#ad23c66c8f6ff167a8f32737904674cad), the data format matches Tegra hardware so that no format conversion
55 is required. Calling [decodeToBuffer](classNvJPEGDecoder.html#a36819bd7bb80afc37854539c3d24a83a) requires converting the buffer to software format after
56 hardware-accelerated JPEG decoding. The JPEG file format contains the standard software format.
57 
58 - - - - - - - - - - - - - - -
59 <a name="key">
60 ## Key Structure and Classes ##
61 
62 This sample uses the following key structures and classes:
63 
64 |Element|Description|
65 |---|---|
66 |[NvVideoConverter](classNvVideoConverter.html)|Contains elements and functions for video format conversion.|
67 |[NvJpegDecoder](classNvJpegDecoder.html)|Contains elements and functions for decoding JPEG images.|
68 
69 %NvVideoConverter contains all video converting related elements and functions. Key members of %NvVideoConverter used in the sample are:
70 
71 |%NvVideoConverter Member|Description|
72 |---|---|
73 |[output_plane](classNvV4l2Element.html#aaba251827cef1b23e7c42f776e95fee5)|V4l2 output plane.|
74 |[capture_plane](classNvV4l2Element.html#a91806d7ed13b4b2c48758e8a02f46c6d)|V4l2 capture plane.|
75 |[waitForIdle](classNvVideoConverter.html#a2f5d1a234427862adf9cae7323b5e24c)|Wait until all queued output plane buffers are processed and dequeued from the capture plane.|
76 |[setOutputPlaneFormat](classNvVideoDecoder.html#a7cacbe8afce830495c25514cbd7c8efe)|Set output plane format.|
77 |[setCapturePlaneFormat](classNvVideoDecoder.html#abc20773d70cfafed881238dfda6046ce)|Set capture plane format.|
78 
79 The %NvVideoConverter elements `output_plane` and `capture_plane` belong to the NvV4l2ElementPlane class. Key members of [NvV4l2ElementPlane](group__l4t_mm__nvv4lelementplane__group.html) used in the sample are as follows:
80 
81 |Element|Description|
82 |---|---|
83 |[setupPlane](classNvV4l2ElementPlane.html#a89959f455e5222f686187cc826b1b345)|Setup the plane of V4l2 element.|
84 |[deinitPlane](classNvV4l2ElementPlane.html#af89cfe87d8f818beb0478bcf5b72574c)|Destroy the plane of V4l2 element.|
85 |[setStreamStatus](classNvV4l2ElementPlane.html#a03164dde4d7ab41f3e92b41e13059316)|Start/Stop the stream.|
86 |[setDQThreadCallback](classNvV4l2ElementPlane.html#a37f213325e0e4857180f5b2319317d6a)|Set the callback function of the dqueue buffer thread.|
87 |[startDQThread](classNvV4l2ElementPlane.html#a31f77f5e5ed1f320caa44a868a7cbedd)|Start the thread of the dqueue buffer.|
88 |[stopDQThread](classNvV4l2ElementPlane.html#aa798d14493de321fa90aeab6d944ca87)|Stop the thread of the dqueue buffer.|
89 |[qBuffer](classNvV4l2ElementPlane.html#af4d52964fcfd37082f47682e457f5e95)|Queue the V4l2 buffer.|
90 |[dqBuffer](classNvV4l2ElementPlane.html#a8dfcbc666ee6f36a02abfb1170ae05cd)|Dequeue the V4l2 buffer.|
91 |[getNumBuffers](classNvV4l2ElementPlane.html#ac5cd394a7e0a4afd69395759aeac8787)|Get the number of the V4l2 buffer.|
92 |[getNumQueuedBuffers](#NvV4l2ElementPlane::getNumQueuedBuffers)|Get the number of the V4l2 buffer under queue.|
93 |[getNthBuffer](classNvV4l2ElementPlane.html#a868d438908f3d267dd4af1033133892f)| Get the NvBuffer at Index N.|
94 
95 The [NvJpegDecoder](classNvJPEGDecoder.html) class contains all of the functions for JPEG image decoding. Key members used are:
96 
97 |Function|Description|
98 |---|---|
99 |[decodeToFd](classNvJPEGDecoder.html#ad23c66c8f6ff167a8f32737904674cad)|Decode to hardware buffer (at a file descriptor) where the data is available to other components.|
100 |[decodeToBuffer](classNvJPEGDecoder.html#a36819bd7bb80afc37854539c3d24a83a)|Decode to a software buffer.|
101 
Defines a helper class for operations performed on a V4L2 Element plane.
Class representing a buffer.
Definition: NvBuffer.h:85
Defines a helper class for V4L2 Video Converter.
uint32_t getNumQueuedBuffers()
Gets the number of buffers currently queued on the plane.