This sample shows how to use libargus to create camera objects and interface as frame producer so either EGL image renderer can display, preview, or perform image capture to a JPEG file.
$ cd /usr/src/jetson_multimedia_api/samples/09_camera_jpeg_capture $ make
$ ./camera_jpeg_capture [OPTIONS]
The captured preview stream can display over HDMI. JPEG files are stored in the current directory.
$ ./camera_jpeg_capture -h
The following diagram shows the flow of data through the sample.
The sample uses producer and consumer model to establish frame flow from camera object producing frame output to consumer connecting EGLstream buffer for rendering preview mode.
The programming model is quite straightforward and efficient once you are familiar with it.
The API is frame-based cross-platform user mode API. The design is to ensure zero buffer copy when it comes to consuming output frame.
Regarding libargus and EGLStream, please refer to libargus document.
Classes | Description |
---|---|
class NvEglRenderer | The class contains elements and functions to render frames to EGL window. |
class NvJpegEncoder | The class contains elements and functions to encode JPEG images. |
NvEglRendererRenderer is the class that packages all the functions for video rendering. Key members used in the sample are as follows:
NvEglRenderer | Description |
---|---|
NvEglRenderer::render | Render the FD to an EGL window. |
NvJpegEncoder is the class that packages all the functions for JPEG encoding. Key members used are:
NvV4l2ElementPlane | Description |
---|---|
encodeFromFd | Encode form FD of buffer exported by V4L2 element. |