L4T Multimedia API Reference

32.2 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
multimedia_api/ll_samples/docs/l4t_mm_camera_jpeg_capture.md
Go to the documentation of this file.
1 Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
2 
3 @page l4t_mm_jpeg_capture_group 09_camera_jpeg_capture
4 
5 @{
6 
7  - [Overview](#overview)
8  - [Building and Running](#build_and_run)
9  - [Flow](#flow)
10  - [Key Structure and Classes](#key)
11 
12 - - - - - - - - - - - - -
13 <a name="overview">
14 ## Overview ##
15 
16 This sample shows how to use libargus to create camera objects and interface as frame producer so either EGL
17 image renderer can display, preview, or perform image capture to a JPEG file.
18 
19 
20 <a name="build_and_run">
21 - - - - - - - - - - - - - - -
22 ## Building and Running ##
23 
24 ### Prerequisites ####
25 
26 * You have followed Steps 1-3 in @ref mmapi_build.
27 * If you are building from your host Linux PC (x86), you have
28  followed Step 4 in @ref mmapi_build.
29 * You have a camera.
30 
31 ### To build:
32 * Enter:
33 
34  $ cd $HOME/tegra_multimedia_api/samples/09_camera_jpeg_capture
35  $ make
36 
37 ### To run
38 * Enter:
39 
40  $ ./camera_jpeg_capture [OPTIONS]
41 
42 The captured preview stream can display over HDMI. JPEG files are
43 stored in the current directory.
44 
45 ### To view supported options
46 
47  $ ./camera_jpeg_capture -h
48 
49 
50 <a name="flow">
51 - - - - - - - - - - - - - - -
52 ## Flow
53 The following diagram shows the flow of data through the sample.
54 
55 ![](l4t_mm_camera_jpeg_capture.jpg)
56 
57 The sample uses producer and consumer model to establish frame flow from camera object producing frame
58 output to consumer connecting EGLstream buffer for rendering preview mode.
59 
60 The programming model is quite straightforward and efficient once you are familiar with it.
61 
62 The API is frame-based cross-platform user mode API. The design is to ensure zero buffer copy when it
63 comes to consuming output frame.
64 
65 <a name="key">
66 - - - - - - - - - - - - - - -
67 ## Key Structure and Classes ##
68 
69 Regarding libargus and EGLStream, please refer to libargus document.
70 
71 |Classes|Description|
72 |-------|-----------|
73 | class [NvEGLRender](classNvEglRenderer.html) | The class contains elements and functions to render frames to EGL window. |
74 | class [NvJpegEncoder](classNvJPEGEncoder.html) | The class contains elements and functions to encode JPEG images.
75 
76 %NvEGLRender is the class that packages all the functions for video rendering. Key members used in the
77 sample are as follows:
78 
79 | %NvEGLRender | Description |
80 |-------------|-------------|
81 | NvEglRenderer::render | Render the FD to an EGL window. |
82 
83 %NvJpegEncoder is the class that packages all the functions for JPEG encoding. Key members used are:
84 
85 | %NvV4l2ElementPlane | Description |
86 |--------------------|-------------|
87 | [encodeFromFd](classNvJPEGEncoder.html#a4c7f16d4d8ee39fcc52279ee14418fea) | Encode form FD of buffer exported by V4L2 element. |
88 
89 
90 
91 @}
Defines a helper class for operations performed on a V4L2 Element plane.
int render(int fd)
Renders a buffer.