1 Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
2 <!-- Sample is in the backend dir. -->
4 @page nvvid_13_multi_camera_group 13_multi_camera
7 - [Overview](#overview)
8 - [Building and Running](#build_and_run)
10 - [Key Structure and Classes](#key)
12 - - - - - - - - - - - - - - -
16 The multi_camera sample captures multiple cameras and composites them to one frame.
17 After compositing the images, the sample renders the composited frame on the display.
19 The sample uses the multi-session feature in libargus to capture several
20 cameras simultaneously. It uses cameras as follows:
21 - Camera 0 is the base camera, which is used as background in the
final picture.
22 - Camera 1-N (N <=5) is used for window overlays. The sample places overlays
23 on top of the background, to create the Picture in Picture layout.
25 The following diagram shows the result of the compositing the camera output.
26 If Camera 1-5 does not exist, the corresponding window is absent.
28 
31 * Camera board with multiple sensors.
34 <a name="build_and_run">
35 ## Building and Running ##
37 #### Prerequisites ####
39 * You have followed Steps 1-3 in @ref mmapi_build.
52 $ ./multi_camera [-n <number of cameras>]
55 - - - - - - - - - - - - - - -
58 The following image shows the movement of data through the sample.
60 
62 - - - - - - - - - - - - - - -
64 ## Key Structure and Classes ##
66 The following tables describe the key NvMedia declarations that the sample uses.
68 |Class and Method|Description|
70 |#
NvEglRenderer | The
class contains elements and functions to render frames to EGL window.|
75 |Functions|Description|
77 |
NvBufferCreateEx() | Creates a DMA buffer. The sample uses
this function to create the buffer
for the composited image and
for the input images.|
81 For guidance on the libargus APIs, see @ref LibargusAPI.
83 The following table describes the key sample elements.
87 |Execute | Producer thread that creates output streams and submits capture requests.|
88 |ConsumerThread::threadExecute |Consumer thread that reads frames from multiple cameras.|
89 |CaptureHolder | Class that represents a single camera. This
class contains all @ref LibargusAPI resources to capture frames from that camera.|
Interface to the core CaptureSession methods.
int NvBufferComposite(int *src_dmabuf_fds, int dst_dmabuf_fd, NvBufferCompositeParams *composite_params)
This method is used to composite multiple input DMA buffers to one output DMA buffer.
NvEglRenderer is a helper class for rendering using EGL and OpenGL ES 2.0.
int NvBufferDestroy(int dmabuf_fd)
This method must be used for destroying hw_buffer.
int NvBufferCreateEx(int *dmabuf_fd, NvBufferCreateParams *input_params)
Use this method to allocate HW buffer.
int render(int fd)
Renders a buffer.